src/gdk-pixbuf-drawable.c: Changed the behavior to return NULL if part of
authorCody Russell <bratsche@src.gnome.org>
Wed, 3 Nov 1999 00:37:40 +0000 (00:37 +0000)
committerCody Russell <bratsche@src.gnome.org>
Wed, 3 Nov 1999 00:37:40 +0000 (00:37 +0000)
the requested image is offscreen, rather than clipping the image.

gdk-pixbuf/ChangeLog
gdk/gdkpixbuf-drawable.c

index 3091185caefec710d8022027c34aada94e7ab714..1a9aef5eccc029dd9e94962d807316504e735347 100644 (file)
@@ -1,3 +1,8 @@
+1999-11-02  Cody Russell  <bratsche@dfw.net>
+       * src/gdk-pixbuf-drawable.c: Changed the behavior to return NULL
+       if part of the requested image is offscreen, rather than clipping
+       the image.
+
 1999-11-02  Jonathan Blandford  <jrb@redhat.com>
 
        * src/io-gif.c (gif_fill_in_lines): Fill in the gif's blank areas
index dbbd6f18b1467f5c2d7a257edf70cad1de74e7a1..d0c3151f10369498f7e2175651ac5223b375b4df 100644 (file)
@@ -39,20 +39,12 @@ gdk_pixbuf_from_drawable_core (GdkWindow *window, gint x, gint y, gint width, gi
                                &window_width, &window_height, NULL);
        gdk_window_get_origin(window, &window_x, &window_y);
 
-       if(window_x < 0) {
-               x = ABS(window_x);
-               width = window_width - x;
-       } else {
-               width = CLAMP(window_x + window_width, window_x,
-                             screen_width) - window_x;
-       }
-
-       if(window_y < 0) {
-               y = ABS(window_y);
-               height = window_height - y;
-       } else {
-               height = CLAMP(window_y + window_height, window_y,
-                              screen_height) - window_y;
+       /* If part of the requested image is offscreen, return NULL. */
+       if((window_x) < 0 || (window_y < 0) ||
+               (window_x + window_width > screen_width) ||
+               (window_y + window_height > screen_height))
+       {
+               return NULL;
        }
 
        image = gdk_image_get (window, x, y, width, height);